From: Thomas Leonard Date: Thu, 26 Jun 2014 11:28:33 +0000 (+0100) Subject: mini-os: use irqs_disabled() helper in schedule X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4772 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=18b2061a136ce4fa72772f065cf9089057673b56;p=xen.git mini-os: use irqs_disabled() helper in schedule Testing whether the result of local_irq_save is zero doesn't work on ARM. Suggested by Julien Grall. Signed-off-by: Thomas Leonard Acked-by: Samuel Thibault --- diff --git a/extras/mini-os/sched.c b/extras/mini-os/sched.c index 99d87b609f..d0c607e843 100644 --- a/extras/mini-os/sched.c +++ b/extras/mini-os/sched.c @@ -78,6 +78,11 @@ void schedule(void) struct thread *prev, *next, *thread, *tmp; unsigned long flags; + if (irqs_disabled()) { + printk("Must not call schedule() with IRQs disabled\n"); + BUG(); + } + prev = current; local_irq_save(flags); @@ -86,11 +91,6 @@ void schedule(void) BUG(); } - if (flags) { - printk("Must not call schedule() with IRQs disabled\n"); - BUG(); - } - do { /* Examine all threads. Find a runnable thread, but also wake up expired ones and find the